$('#user-add').click(function () {
    $.ajax({
        url: "/citrusmonitor/user.do?method=register",
        type: "post",
        contentType: "application/x-www-form-urlencoded;charset=utf-8",
        data: {
            "phone": $("#phone").val(),
            "password": $("#password").val(),
            "realName": $("#real_name").val(),
            "gender": $("#gender").val(),
            "email": $("#email").val(),
            "role": $("#role").val()
        },
        
        dataType: "json",
        success: function (msg) {
            if (msg.status==1) {
                alert("添加成功");
                window.location.href="showUser.html";
            } else {
                alert("添加失败" );
            }
        },
        error:function(){
            alert("资源加载失败！！！");
        }
    })
})